g_object_add_weak_pointer (G_OBJECT (parent), (gpointer *) &parent);
}
- g_list_foreach (hierarchy, (GFunc) g_object_unref, NULL);
- g_list_free (hierarchy);
+ g_list_free_full (hierarchy, g_object_unref);
if (found)
return TRUE;
static void
pending_select_files_free (GtkFileChooserDefault *impl)
{
- g_slist_foreach (impl->pending_select_files, (GFunc) g_object_unref, NULL);
- g_slist_free (impl->pending_select_files);
+ g_slist_free_full (impl->pending_select_files, g_object_unref);
impl->pending_select_files = NULL;
}
if (priv->themes_valid)
{
g_hash_table_destroy (priv->all_icons);
- g_list_foreach (priv->themes, (GFunc)theme_destroy, NULL);
- g_list_free (priv->themes);
- g_list_foreach (priv->dir_mtimes, (GFunc)free_dir_mtime, NULL);
- g_list_free (priv->dir_mtimes);
+ g_list_free_full (priv->themes, (GDestroyNotify) theme_destroy);
+ g_list_free_full (priv->dir_mtimes, (GDestroyNotify) free_dir_mtime);
g_hash_table_destroy (priv->unthemed_icons);
}
priv->themes = NULL;
g_free (theme->name);
g_free (theme->example);
- g_list_foreach (theme->dirs, (GFunc)theme_dir_destroy, NULL);
- g_list_free (theme->dirs);
+ g_list_free_full (theme->dirs, (GDestroyNotify) theme_dir_destroy);
g_free (theme);
}
g_free (icon_info->filename);
if (icon_info->loadable)
g_object_unref (icon_info->loadable);
- g_slist_foreach (icon_info->emblem_infos, (GFunc)gtk_icon_info_free, NULL);
- g_slist_free (icon_info->emblem_infos);
+ g_slist_free_full (icon_info->emblem_infos, (GDestroyNotify) gtk_icon_info_free);
if (icon_info->pixbuf)
g_object_unref (icon_info->pixbuf);
if (icon_info->cache_pixbuf)
g_object_unref (icon_view->priv->model);
- g_list_foreach (icon_view->priv->items, (GFunc)gtk_icon_view_item_free, NULL);
- g_list_free (icon_view->priv->items);
+ g_list_free_full (icon_view->priv->items, (GDestroyNotify) gtk_icon_view_item_free);
icon_view->priv->items = NULL;
icon_view->priv->anchor_item = NULL;
icon_view->priv->cursor_item = NULL;
*
* To free the return value, use:
* |[
- * g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL);
- * g_list_free (list);
+ * g_list_free_full (list, (GDestroyNotify) gtk_tree_patch_free);
* ]|
*
* Return value: (element-type GtkTreePath) (transfer full): A #GList containing a #GtkTreePath for each selected row.
failed:
g_markup_parse_context_free (context);
g_string_free (pdata.new_str, TRUE);
- g_list_foreach (pdata.links, (GFunc)link_free, NULL);
- g_list_free (pdata.links);
+ g_list_free_full (pdata.links, (GDestroyNotify) link_free);
gdk_color_free (pdata.link_color);
gdk_color_free (pdata.visited_link_color);
if (!priv->select_info)
return;
- g_list_foreach (priv->select_info->links, (GFunc)link_free, NULL);
- g_list_free (priv->select_info->links);
+ g_list_free_full (priv->select_info->links, (GDestroyNotify) link_free);
priv->select_info->links = NULL;
priv->select_info->active_link = NULL;
}
list = g_list_prepend (list, gtk_paper_size_copy (size));
}
- g_list_foreach (page_setups, (GFunc) g_object_unref, NULL);
- g_list_free (page_setups);
+ g_list_free_full (page_setups, g_object_unref);
}
#endif
for (i = 0; i < G_N_ELEMENTS (standard_names_offsets); ++i)
else
gtk_widget_hide (priv->advanced_page);
- g_list_foreach (groups, (GFunc) g_free, NULL);
- g_list_free (groups);
+ g_list_free_full (groups, g_free);
}
static void
GList *l;
gchar *mime_type;
- g_list_foreach (query->priv->mime_types, (GFunc)g_free, NULL);
- g_list_free (query->priv->mime_types);
+ g_list_free_full (query->priv->mime_types, g_free);
query->priv->mime_types = NULL;
for (l = mime_types; l; l = l->next)
if (length)
*length = i;
- g_list_foreach (items,
- (GFunc) gtk_recent_info_unref,
- NULL);
- g_list_free (items);
+ g_list_free_full (items, (GDestroyNotify) gtk_recent_info_unref);
return retval;
}
impl->load_id = 0;
}
- if (impl->recent_items)
- {
- g_list_foreach (impl->recent_items, (GFunc) gtk_recent_info_unref, NULL);
- g_list_free (impl->recent_items);
- impl->recent_items = NULL;
- }
+ g_list_free_full (impl->recent_items, (GDestroyNotify) gtk_recent_info_unref);
+ impl->recent_items = NULL;
if (impl->manager && impl->manager_changed_id)
{
/* we have finished loading, so we remove the items cache */
impl->load_state = LOAD_LOADING;
- g_list_foreach (impl->recent_items,
- (GFunc) gtk_recent_info_unref,
- NULL);
- g_list_free (impl->recent_items);
+ g_list_free_full (impl->recent_items, (GDestroyNotify) gtk_recent_info_unref);
impl->recent_items = NULL;
impl->n_recent_items = 0;
if (pdata->loaded_items == pdata->n_items)
{
- g_list_foreach (pdata->items, (GFunc) gtk_recent_info_unref, NULL);
- g_list_free (pdata->items);
+ g_list_free_full (pdata->items, (GDestroyNotify) gtk_recent_info_unref);
priv->populate_id = 0;
l = clamp->next;
clamp->next = NULL;
- g_list_foreach (l, (GFunc) gtk_recent_info_unref, NULL);
- g_list_free (l);
+ g_list_free_full (l, (GDestroyNotify) gtk_recent_info_unref);
}
return items;
hits->uris);
}
- g_list_foreach (hits->uris, (GFunc)g_free, NULL);
- g_list_free (hits->uris);
+ g_list_free_full (hits->uris, g_free);
g_free (hits);
return FALSE;
g_object_unref (data->store);
clear_property_cache (data);
- g_slist_foreach (data->icon_factories, (GFunc) g_object_unref, NULL);
- g_slist_free (data->icon_factories);
+ g_slist_free_full (data->icon_factories, g_object_unref);
g_slice_free (StyleData, data);
}
g_hash_table_destroy (priv->style_data);
- g_list_foreach (priv->providers, (GFunc) style_provider_data_free, NULL);
- g_list_free (priv->providers);
+ g_list_free_full (priv->providers, (GDestroyNotify) style_provider_data_free);
- g_slist_foreach (priv->info_stack, (GFunc) style_info_free, NULL);
- g_slist_free (priv->info_stack);
+ g_slist_free_full (priv->info_stack, (GDestroyNotify) style_info_free);
g_slist_free (priv->animation_regions);
static void
free_format_list (GList *formats)
{
- g_list_foreach (formats, (GFunc) free_format, NULL);
- g_list_free (formats);
+ g_list_free_full (formats, (GDestroyNotify) free_format);
}
static GQuark
return g_list_reverse (headers);
error:
- g_list_foreach (headers, (GFunc) g_free, NULL);
- g_list_free (headers);
+ g_list_free_full (headers, g_free);
g_set_error_literal (error,
G_MARKUP_ERROR,
create_tags, error, headers->next);
out:
- g_list_foreach (headers, (GFunc)g_free, NULL);
- g_list_free (headers);
+ g_list_free_full (headers, g_free);
return retval;
}
if (selected_rows)
{
cursor_path = gtk_tree_path_copy((const GtkTreePath *)(selected_rows->data));
- g_list_foreach (selected_rows, (GFunc)gtk_tree_path_free, NULL);
- g_list_free (selected_rows);
+ g_list_free_full (selected_rows, (GDestroyNotify) gtk_tree_path_free);
}
else
{
g_node_destroy (manager->private_data->root_node);
manager->private_data->root_node = NULL;
- g_list_foreach (manager->private_data->action_groups,
- (GFunc) g_object_unref, NULL);
- g_list_free (manager->private_data->action_groups);
+ g_list_free_full (manager->private_data->action_groups, g_object_unref);
manager->private_data->action_groups = NULL;
g_object_unref (manager->private_data->accel_group);
{
Node *info = NODE_INFO (node);
- g_list_foreach (info->uifiles, (GFunc) node_ui_reference_free, NULL);
- g_list_free (info->uifiles);
+ g_list_free_full (info->uifiles, node_ui_reference_free);
if (info->action)
g_object_unref (info->action);
}
g_object_unref (relation_set);
- g_slist_foreach (atk_relations, (GFunc)free_relation, NULL);
- g_slist_free (atk_relations);
+ g_slist_free_full (atk_relations, (GDestroyNotify) free_relation);
g_object_set_qdata (G_OBJECT (buildable), quark_builder_atk_relations,
NULL);
}
else
g_warning ("accessibility action on a widget that does not implement AtkAction");
- g_slist_foreach (a11y_data->actions, (GFunc)free_action, NULL);
- g_slist_free (a11y_data->actions);
+ g_slist_free_full (a11y_data->actions, (GDestroyNotify) free_action);
}
if (a11y_data->relations)
{
GtkIconTheme *icon_theme;
- g_list_foreach (icon_list, (GFunc) g_object_unref, NULL);
- g_list_free (icon_list);
+ g_list_free_full (icon_list, g_object_unref);
icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (window)));
g_signal_connect (icon_theme, "changed",
g_list_foreach (list,
(GFunc) g_object_ref, NULL);
- g_list_foreach (info->icon_list,
- (GFunc) g_object_unref, NULL);
-
- g_list_free (info->icon_list);
+ g_list_free_full (info->icon_list, g_object_unref);
info->icon_list = g_list_copy (list);
info->icon_name = g_strdup (name);
g_free (tmp);
- g_list_foreach (info->icon_list, (GFunc) g_object_unref, NULL);
- g_list_free (info->icon_list);
+ g_list_free_full (info->icon_list, g_object_unref);
info->icon_list = NULL;
update_themed_icon (NULL, window);
g_list_foreach (list,
(GFunc) g_object_ref, NULL);
- g_list_foreach (default_icon_list,
- (GFunc) g_object_unref, NULL);
-
- g_list_free (default_icon_list);
+ g_list_free_full (default_icon_list, g_object_unref);
default_icon_list = g_list_copy (list);
g_free (default_icon_name);
default_icon_name = g_strdup (name);
- g_list_foreach (default_icon_list,
- (GFunc) g_object_unref, NULL);
-
- g_list_free (default_icon_list);
+ g_list_free_full (default_icon_list, g_object_unref);
default_icon_list = NULL;
/* Update all toplevels */
}
cache = NULL;
- g_list_foreach (directories, (GFunc)g_free, NULL);
- g_list_free (directories);
+ g_list_free_full (directories, g_free);
if (!validate_file (tmp_cache_path))
{